<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qextserialport.cpp -->
  <title>QtExtSerialPort : QextSerialPort Class</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="postheader" valign="center"><a href="index.html">Home</a> &middot; <a href="classes.html">All Classes</a> &middot;</td></tr></table><li><a href="http://doc.qt.nokia.com/qt5/modules.html">Modules</a></li>
<li>QtExtSerialPort</li>
<li>QextSerialPort</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signal">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#usage">Usage</a></li>
<li class="level2"><a href="#compatibility">Compatibility</a></li>
</ul>
</div>
<h1 class="title">QextSerialPort Class</h1>
<!-- $$$QextSerialPort-brief -->
<p>The QextSerialPort class encapsulates a serial port on both POSIX and Windows systems. <a href="#details">More...</a></p>
<!-- @@@QextSerialPort -->
<pre class="cpp">    <span class="preprocessor">#include &lt;QextSerialPort&gt;</span></pre><p><b>Inherits: </b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html">QIODevice</a>.</p>
<ul>
<li><a href="qextserialport-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#BaudRateType-enum">BaudRateType</a></b> { BAUD50, BAUD75, BAUD110, BAUD134, ..., BAUD4000000 }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#DataBitsType-enum">DataBitsType</a></b> { DATA_5, DATA_6, DATA_7, DATA_8 }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#ErrorNumber-enum">ErrorNumber</a></b> { E_NO_ERROR }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#FlowType-enum">FlowType</a></b> { FLOW_OFF, FLOW_HARDWARE, FLOW_XONXOFF }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#LineID-enum">LineID</a></b> { LS_CTS, LS_DSR, LS_DCD, LS_RI, ..., LS_SR }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#OpenMode-typedef">OpenMode</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#OpenModeFlag-enum">OpenModeFlag</a></b> { NotOpen, ReadOnly, WriteOnly, ReadWrite, ..., Unbuffered }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#ParityType-enum">ParityType</a></b> { PAR_NONE, PAR_ODD, PAR_EVEN, PAR_MARK, PAR_SPACE }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#StopBitsType-enum">StopBitsType</a></b> { STOP_1, STOP_1_5, STOP_2 }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qextserialport.html#baudRate-prop">baudRate</a></b> : BaudRateType</li>
<li class="fn"><b><a href="qextserialport.html#dataBits-prop">dataBits</a></b> : DataBitsType</li>
<li class="fn"><b><a href="qextserialport.html#flowControl-prop">flowControl</a></b> : FlowType</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qextserialport.html#parity-prop">parity</a></b> : ParityType</li>
<li class="fn"><b><a href="qextserialport.html#portName-prop">portName</a></b> : QString</li>
<li class="fn"><b><a href="qextserialport.html#stopBits-prop">stopBits</a></b> : StopBitsType</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">1 property inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#QIODevice">QIODevice</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#QIODevice-2">QIODevice</a></b>(QObject *<i> parent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#QextSerialPort">QextSerialPort</a></b>(QObject *<i> parent</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#QextSerialPort-2">QextSerialPort</a></b>(const QString &amp;<i> name</i>, QObject *<i> parent</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#QextSerialPort-3">QextSerialPort</a></b>(const QString &amp;<i> name</i>, BaudRateType<i> baud</i>, QObject *<i> parent</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#QextSerialPort-4">QextSerialPort</a></b>(const QString &amp;<i> name</i>, BaudRateType<i> baud</i>, ParityType<i> par</i>, DataBitsType<i> dataBits</i>, StopBitsType<i> stopBits</i>, QObject *<i> parent</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#dtor.QIODevice">~QIODevice</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#dtor.QextSerialPort">~QextSerialPort</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#atEnd">atEnd</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> BaudRateType </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#baudRate-prop">baudRate</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#bytesAvailable">bytesAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#bytesToWrite">bytesToWrite</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#canReadLine">canReadLine</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#close">close</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> DataBitsType </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#dataBits-prop">dataBits</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#errorString">errorString</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> FlowType </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#flowControl-prop">flowControl</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#flush">flush</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#getChar">getChar</a></b>(char *<i> c</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isOpen">isOpen</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isReadable">isReadable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isSequential">isSequential</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isTextModeEnabled">isTextModeEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isWritable">isWritable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ulong </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#lastError">lastError</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ulong </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#lineStatus">lineStatus</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#open">open</a></b>(OpenMode<i> mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#openMode">openMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ParityType </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#parity-prop">parity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#peek">peek</a></b>(char *<i> data</i>, qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#peek-2">peek</a></b>(qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#portName-prop">portName</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#pos">pos</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#putChar">putChar</a></b>(char<i> c</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#read">read</a></b>(char *<i> data</i>, qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#read-2">read</a></b>(qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#readAll">readAll</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#readLine">readLine</a></b>(char *<i> data</i>, qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#readLine-2">readLine</a></b>(qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#reset">reset</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#seek">seek</a></b>(qint64<i> pos</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#setTextModeEnabled">setTextModeEnabled</a></b>(bool<i> enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#size">size</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> StopBitsType </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#stopBits-prop">stopBits</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#ungetChar">ungetChar</a></b>(char<i> c</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#waitForBytesWritten">waitForBytesWritten</a></b>(int<i> msecs</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#waitForReadyRead">waitForReadyRead</a></b>(int<i> msecs</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#write">write</a></b>(const char *<i> data</i>, qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#write-3">write</a></b>(const QByteArray &amp;<i> byteArray</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#write-2">write</a></b>(const char *<i> data</i>)</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual qint64 </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#bytesAvailable">bytesAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#canReadLine">canReadLine</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#close">close</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#isSequential">isSequential</a></b>() const</td></tr>
</table>
<ul>
<li class="fn">30 public functions inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#baudRate-prop">setBaudRate</a></b>(BaudRateType<i> baudRate</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#dataBits-prop">setDataBits</a></b>(DataBitsType<i> dataBits</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#setDtr">setDtr</a></b>(bool<i> set</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#flowControl-prop">setFlowControl</a></b>(FlowType<i> flow</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#parity-prop">setParity</a></b>(ParityType<i> parity</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#portName-prop">setPortName</a></b>(const QString &amp;<i> name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#setRts">setRts</a></b>(bool<i> set</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#stopBits-prop">setStopBits</a></b>(StopBitsType<i> stopBits</i>)</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#aboutToClose">aboutToClose</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#bytesWritten">bytesWritten</a></b>(qint64<i> bytes</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#dsrChanged">dsrChanged</a></b>(bool<i> status</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#readChannelFinished">readChannelFinished</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#readyRead">readyRead</a></b>()</td></tr>
</table>
<ul>
<li class="fn">2 signal inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#readData">readData</a></b>(char *<i> data</i>, qint64<i> maxSize</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#readLineData">readLineData</a></b>(char *<i> data</i>, qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#setErrorString">setErrorString</a></b>(const QString &amp;<i> str</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#setOpenMode">setOpenMode</a></b>(QFlags&lt;QIODevice::OpenModeFlag&gt;<i> openMode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#writeData">writeData</a></b>(const char *<i> data</i>, qint64<i> maxSize</i>) = 0</td></tr>
</table>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual qint64 </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#readData">readData</a></b>(char *<i> data</i>, qint64<i> maxSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual qint64 </td><td class="memItemRight bottomAlign"><b><a href="qextserialport.html#writeData">writeData</a></b>(const char *<i> data</i>, qint64<i> maxSize</i>)</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public variable inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#public-variables">QObject</a></li>
<li class="fn">10 static public members inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#static-public-members">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="http://doc.qt.nokia.com/qt5/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QextSerialPort-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QextSerialPort class encapsulates a serial port on both POSIX and Windows systems.</p>
<a name="usage"></a>
<h3>Usage</h3>
<p>QextSerialPort offers both a polling and event driven API. Event driven is typically easier to use, since you never have to worry about checking for new data.</p>
<p><b>Example</b></p>
<pre class="cpp">    QextSerialPort<span class="operator">*</span> port <span class="operator">=</span> <span class="keyword">new</span> <a href="qextserialport.html#QextSerialPort">QextSerialPort</a>(<span class="string">&quot;COM1&quot;</span><span class="operator">,</span> QextSerialPort<span class="operator">::</span>EventDriven);
    <a href="http://doc.qt.nokia.com/qt5/qobject.html#connect">connect</a>(port<span class="operator">,</span> SIGNAL(readyRead())<span class="operator">,</span> myClass<span class="operator">,</span> SLOT(onDataAvailable()));
    port<span class="operator">-</span><span class="operator">&gt;</span><a href="qextserialport.html#open">open</a>();

    <span class="type">void</span> MyClass<span class="operator">::</span>onDataAvailable()
    {
        <span class="type"><a href="http://doc.qt.nokia.com/qt5/qbytearray.html">QByteArray</a></span> data <span class="operator">=</span> port<span class="operator">-</span><span class="operator">&gt;</span>readAll();
        processNewData(usbdata);
    }</pre>
<a name="compatibility"></a>
<h3>Compatibility</h3>
<p>The user will be notified of errors and possible portability conflicts at run-time by default.</p>
<p>For example, if a application has used BAUD1800, when it is runing under unix, you will get following message.</p>
<pre class="cpp">    QextSerialPort Portability Warning: Windows does <span class="keyword">not</span> support baudRate:<span class="number">1800</span></pre>
<p>This behavior can be turned off by defining macro QESP_NO_WARN (to turn off all warnings) or QESP_NO_PORTABILITY_WARN (to turn off portability warnings) in the project.</p>
<p><b>Author</b>: Stefan Sander, Michal Policht, Brandon Fosdick, Liam Staskawicz, Debao Zhang</p>
</div>
<!-- @@@QextSerialPort -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$BaudRateType$$$BAUD50$$$BAUD75$$$BAUD134$$$BAUD150$$$BAUD200$$$BAUD1800$$$BAUD76800$$$BAUD230400$$$BAUD460800$$$BAUD500000$$$BAUD576000$$$BAUD921600$$$BAUD1000000$$$BAUD1152000$$$BAUD1500000$$$BAUD2000000$$$BAUD2500000$$$BAUD3000000$$$BAUD3500000$$$BAUD4000000$$$BAUD14400$$$BAUD56000$$$BAUD128000$$$BAUD256000$$$BAUD110$$$BAUD300$$$BAUD600$$$BAUD1200$$$BAUD2400$$$BAUD4800$$$BAUD9600$$$BAUD19200$$$BAUD38400$$$BAUD57600$$$BAUD115200 -->
<h3 class="fn"><a name="BaudRateType-enum"></a>enum QextSerialPort::<span class="name">BaudRateType</span></h3>
<p>baud rate values support.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD50</tt></td><td class="topAlign"><tt>50</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD75</tt></td><td class="topAlign"><tt>75</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD110</tt></td><td class="topAlign"><tt>110</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD134</tt></td><td class="topAlign"><tt>134</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD150</tt></td><td class="topAlign"><tt>150</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD200</tt></td><td class="topAlign"><tt>200</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD300</tt></td><td class="topAlign"><tt>300</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD600</tt></td><td class="topAlign"><tt>600</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD1200</tt></td><td class="topAlign"><tt>1200</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD1800</tt></td><td class="topAlign"><tt>1800</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD2400</tt></td><td class="topAlign"><tt>2400</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD4800</tt></td><td class="topAlign"><tt>4800</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD9600</tt></td><td class="topAlign"><tt>9600</tt></td><td class="topAlign">(default)</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD14400</tt></td><td class="topAlign"><tt>14400</tt></td><td class="topAlign">WINDOWS ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD19200</tt></td><td class="topAlign"><tt>19200</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD38400</tt></td><td class="topAlign"><tt>38400</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD56000</tt></td><td class="topAlign"><tt>56000</tt></td><td class="topAlign">WINDOWS ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD57600</tt></td><td class="topAlign"><tt>57600</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD76800</tt></td><td class="topAlign"><tt>76800</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD115200</tt></td><td class="topAlign"><tt>115200</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD128000</tt></td><td class="topAlign"><tt>128000</tt></td><td class="topAlign">WINDOWS ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD230400</tt></td><td class="topAlign"><tt>230400</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD256000</tt></td><td class="topAlign"><tt>256000</tt></td><td class="topAlign">WINDOWS ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD460800</tt></td><td class="topAlign"><tt>460800</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD500000</tt></td><td class="topAlign"><tt>500000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD576000</tt></td><td class="topAlign"><tt>576000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD921600</tt></td><td class="topAlign"><tt>921600</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD1000000</tt></td><td class="topAlign"><tt>1000000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD1152000</tt></td><td class="topAlign"><tt>1152000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD1500000</tt></td><td class="topAlign"><tt>1500000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD2000000</tt></td><td class="topAlign"><tt>2000000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD2500000</tt></td><td class="topAlign"><tt>2500000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD3000000</tt></td><td class="topAlign"><tt>3000000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD3500000</tt></td><td class="topAlign"><tt>3500000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::BAUD4000000</tt></td><td class="topAlign"><tt>4000000</tt></td><td class="topAlign">POSIX ONLY</td></tr>
</table>
<!-- @@@BaudRateType -->
<!-- $$$DataBitsType$$$DATA_5$$$DATA_6$$$DATA_7$$$DATA_8 -->
<h3 class="fn"><a name="DataBitsType-enum"></a>enum QextSerialPort::<span class="name">DataBitsType</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QextSerialPort::DATA_5</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::DATA_6</tt></td><td class="topAlign"><tt>6</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::DATA_7</tt></td><td class="topAlign"><tt>7</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::DATA_8</tt></td><td class="topAlign"><tt>8</tt></td><td class="topAlign">(default)</td></tr>
</table>
<!-- @@@DataBitsType -->
<!-- $$$ErrorNumber$$$E_NO_ERROR$$$E_INVALID_FD$$$E_NO_MEMORY$$$E_CAUGHT_NON_BLOCKED_SIGNAL$$$E_PORT_TIMEOUT$$$E_INVALID_DEVICE$$$E_BREAK_CONDITION$$$E_FRAMING_ERROR$$$E_IO_ERROR$$$E_BUFFER_OVERRUN$$$E_RECEIVE_OVERFLOW$$$E_RECEIVE_PARITY_ERROR$$$E_TRANSMIT_OVERFLOW$$$E_READ_FAILED$$$E_WRITE_FAILED$$$E_FILE_NOT_FOUND$$$E_PERMISSION_DENIED$$$E_AGAIN -->
<h3 class="fn"><a name="ErrorNumber-enum"></a>enum QextSerialPort::<span class="name">ErrorNumber</span></h3>
<table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><tt>QextSerialPort::E_NO_ERROR</tt></td><td class="topAlign"><tt>0</tt></td></tr>
</table>
<!-- @@@ErrorNumber -->
<!-- $$$FlowType$$$FLOW_OFF$$$FLOW_HARDWARE$$$FLOW_XONXOFF -->
<h3 class="fn"><a name="FlowType-enum"></a>enum QextSerialPort::<span class="name">FlowType</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QextSerialPort::FLOW_OFF</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">No flow control (default)</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::FLOW_HARDWARE</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">Hardware (RTS/CTS) flow control</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::FLOW_XONXOFF</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">Software (XON/XOFF) flow control</td></tr>
</table>
<!-- @@@FlowType -->
<!-- $$$LineID$$$LS_CTS$$$LS_DSR$$$LS_DCD$$$LS_RI$$$LS_RTS$$$LS_DTR$$$LS_ST$$$LS_SR -->
<h3 class="fn"><a name="LineID-enum"></a>enum QextSerialPort::<span class="name">LineID</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_CTS</tt></td><td class="topAlign"><tt>0x01</tt></td><td class="topAlign">CTS</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_DSR</tt></td><td class="topAlign"><tt>0x02</tt></td><td class="topAlign">DSR</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_DCD</tt></td><td class="topAlign"><tt>0x04</tt></td><td class="topAlign">DCD</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_RI</tt></td><td class="topAlign"><tt>0x08</tt></td><td class="topAlign">RI</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_RTS</tt></td><td class="topAlign"><tt>0x10</tt></td><td class="topAlign">RTS (POSIX only)</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_DTR</tt></td><td class="topAlign"><tt>0x20</tt></td><td class="topAlign">DTR (POSIX only)</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_ST</tt></td><td class="topAlign"><tt>0x40</tt></td><td class="topAlign">Secondary TXD (POSIX only)</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::LS_SR</tt></td><td class="topAlign"><tt>0x80</tt></td><td class="topAlign">Secondary RXD (POSIX only)</td></tr>
</table>
<!-- @@@LineID -->
<!-- $$$ParityType$$$PAR_NONE$$$PAR_ODD$$$PAR_EVEN$$$PAR_MARK$$$PAR_SPACE -->
<h3 class="fn"><a name="ParityType-enum"></a>enum QextSerialPort::<span class="name">ParityType</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QextSerialPort::PAR_NONE</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">(default)</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::PAR_ODD</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::PAR_EVEN</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::PAR_MARK</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">Windows only</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::PAR_SPACE</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">&nbsp;</td></tr>
</table>
<!-- @@@ParityType -->
<!-- $$$StopBitsType$$$STOP_1$$$STOP_1_5$$$STOP_2 -->
<h3 class="fn"><a name="StopBitsType-enum"></a>enum QextSerialPort::<span class="name">StopBitsType</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QextSerialPort::STOP_1</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">(default)</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::STOP_1_5</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">Windows only</td></tr>
<tr><td class="topAlign"><tt>QextSerialPort::STOP_2</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">&nbsp;</td></tr>
</table>
<!-- @@@StopBitsType -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$baudRate-prop$$$baudRate$$$setBaudRateBaudRateType -->
<h3 class="fn"><a name="baudRate-prop"></a><span class="name">baudRate</span> : <span class="type"><a href="qextserialport.html#BaudRateType-enum">BaudRateType</a></span></h3>
<p>This property holds gets and sets the baudRate associated with the serial port.</p>
<p>Note that not all rates are applicable on all platforms. For a list of possible values see the definition of the enum <a href="qextserialport.html#BaudRateType-enum">BaudRateType</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> BaudRateType </td><td class="memItemRight bottomAlign"><span class="name"><b>baudRate</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setBaudRate</b></span>(BaudRateType<i> baudRate</i>)</td></tr>
</table>
<!-- @@@baudRate -->
<!-- $$$dataBits-prop$$$dataBits$$$setDataBitsDataBitsType -->
<h3 class="fn"><a name="dataBits-prop"></a><span class="name">dataBits</span> : <span class="type"><a href="qextserialport.html#DataBitsType-enum">DataBitsType</a></span></h3>
<p>This property holds gets and sets the dataBits associated with the serial port.</p>
<p>For a list of possible values, see the definition of the enum <a href="qextserialport.html#DataBitsType-enum">DataBitsType</a>.</p>
<p><b>note</b>: This property is subject to the following restrictions:</p>
<ul>
<li>5 data bits cannot be used with 2 stop bits.</li>
<li>1.5 stop bits can only be used with 5 data bits.</li>
<li>8 data bits cannot be used with space parity on POSIX systems.</li>
</ul>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> DataBitsType </td><td class="memItemRight bottomAlign"><span class="name"><b>dataBits</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDataBits</b></span>(DataBitsType<i> dataBits</i>)</td></tr>
</table>
<!-- @@@dataBits -->
<!-- $$$flowControl-prop$$$flowControl$$$setFlowControlFlowType -->
<h3 class="fn"><a name="flowControl-prop"></a><span class="name">flowControl</span> : <span class="type"><a href="qextserialport.html#FlowType-enum">FlowType</a></span></h3>
<p>This property holds gets and sets the flowControl associated with the serial port.</p>
<p>For a list of possible values, see the definition of the enum <a href="qextserialport.html#FlowType-enum">FlowType</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> FlowType </td><td class="memItemRight bottomAlign"><span class="name"><b>flowControl</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFlowControl</b></span>(FlowType<i> flow</i>)</td></tr>
</table>
<!-- @@@flowControl -->
<!-- $$$parity-prop$$$parity$$$setParityParityType -->
<h3 class="fn"><a name="parity-prop"></a><span class="name">parity</span> : <span class="type"><a href="qextserialport.html#ParityType-enum">ParityType</a></span></h3>
<p>This property holds gets and sets the parity associated with the serial port.</p>
<p>For a list of possible values see the definition of the enum <a href="qextserialport.html#ParityType-enum">ParityType</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> ParityType </td><td class="memItemRight bottomAlign"><span class="name"><b>parity</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setParity</b></span>(ParityType<i> parity</i>)</td></tr>
</table>
<!-- @@@parity -->
<!-- $$$portName-prop$$$portName$$$setPortNameconstQString& -->
<h3 class="fn"><a name="portName-prop"></a><span class="name">portName</span> : <span class="type"><a href="http://doc.qt.nokia.com/qt5/qstring.html">QString</a></span></h3>
<p>This property holds gets and sets the name associated with the serial port.</p>
<p>Port name is platform special, e.g&#x2e; &quot;COM1&quot;, or &quot;/dev/ttyS0&quot;.</p>
<p>You can get available port names by QextSerialEnumrator or <a href="qextserialhelper.html">QextSerialHelper</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>portName</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPortName</b></span>(const QString &amp;<i> name</i>)</td></tr>
</table>
<!-- @@@portName -->
<!-- $$$stopBits-prop$$$stopBits$$$setStopBitsStopBitsType -->
<h3 class="fn"><a name="stopBits-prop"></a><span class="name">stopBits</span> : <span class="type"><a href="qextserialport.html#StopBitsType-enum">StopBitsType</a></span></h3>
<p>This property holds gets and sets the stopBits associated with the serial port.</p>
<p>For a list of possible values, see the definition of the enum <a href="qextserialport.html#StopBitsType-enum">StopBitsType</a>.</p>
<p><b>note</b>: This function is subject to the following restrictions:</p>
<ul>
<li>2 stop bits cannot be used with 5 data bits.</li>
<li>1.5 stop bits cannot be used with 6 or more data bits.</li>
<li>POSIX does not support 1.5 stop bits.</li>
</ul>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> StopBitsType </td><td class="memItemRight bottomAlign"><span class="name"><b>stopBits</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setStopBits</b></span>(StopBitsType<i> stopBits</i>)</td></tr>
</table>
<!-- @@@stopBits -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QextSerialPort[overload1]$$$QextSerialPortQObject* -->
<h3 class="fn"><a name="QextSerialPort"></a>QextSerialPort::<span class="name">QextSerialPort</span>(<span class="type"><a href="http://doc.qt.nokia.com/qt5/qobject.html">QObject</a></span> *<i> parent</i> = 0)</h3>
<p>Constructs a <a href="qextserialport.html">QextSerialPort</a> object with the given <i>parent</i>.</p>
<p>Note that the name of the device used by a <a href="qextserialport.html">QextSerialPort</a> constructed with this constructor will be determined by #defined constants, or lack thereof - the default behavior is the same as <a href="http://doc.qt.nokia.com/qt5/qtglobal.html#Q_OS_LINUX">Q_OS_LINUX</a>. Possible naming conventions and their associated constants are:</p>
<pre class="cpp">    Constant         Used By         Naming Convention
    <span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span>       <span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span>   <span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span><span class="operator">-</span>
    Q_OS_WIN          Windows         COM1<span class="operator">,</span> COM2
    Q_OS_IRIX         SGI<span class="operator">/</span>IRIX        <span class="operator">/</span>dev<span class="operator">/</span>ttyf1<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>ttyf2
    Q_OS_HPUX         HP<span class="operator">-</span>UX           <span class="operator">/</span>dev<span class="operator">/</span>tty1p0<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>tty2p0
    Q_OS_SOLARIS      SunOS<span class="operator">/</span>Solaris   <span class="operator">/</span>dev<span class="operator">/</span>ttya<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>ttyb
    Q_OS_OSF          Digital UNIX    <span class="operator">/</span>dev<span class="operator">/</span>tty01<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>tty02
    Q_OS_FREEBSD      FreeBSD         <span class="operator">/</span>dev<span class="operator">/</span>ttyd0<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>ttyd1
    Q_OS_OPENBSD      OpenBSD         <span class="operator">/</span>dev<span class="operator">/</span>tty00<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>tty01
    Q_OS_LINUX        Linux           <span class="operator">/</span>dev<span class="operator">/</span>ttyS0<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>ttyS1
    <span class="operator">&lt;</span>none<span class="operator">&gt;</span>            Linux           <span class="operator">/</span>dev<span class="operator">/</span>ttyS0<span class="operator">,</span> <span class="operator">/</span>dev<span class="operator">/</span>ttyS1</pre>
<p>This constructor assigns the device name to the name of the first port on the specified system. See the other constructors if you need to open a different port.</p>
<!-- @@@QextSerialPort -->
<!-- $$$QextSerialPort$$$QextSerialPortconstQString&QObject* -->
<h3 class="fn"><a name="QextSerialPort-2"></a>QextSerialPort::<span class="name">QextSerialPort</span>(const <span class="type"><a href="http://doc.qt.nokia.com/qt5/qstring.html">QString</a></span> &amp;<i> name</i>, <span class="type"><a href="http://doc.qt.nokia.com/qt5/qobject.html">QObject</a></span> *<i> parent</i> = 0)</h3>
<p>This is an overloaded function.</p>
<p>Constructs a serial port attached to the port specified by name. <i>name</i> is the name of the device, which is windowsystem-specific, e.g&#x2e;&quot;COM1&quot; or &quot;/dev/ttyS0&quot;.</p>
<!-- @@@QextSerialPort -->
<!-- $$$QextSerialPort$$$QextSerialPortconstQString&BaudRateTypeQObject* -->
<h3 class="fn"><a name="QextSerialPort-3"></a>QextSerialPort::<span class="name">QextSerialPort</span>(const <span class="type"><a href="http://doc.qt.nokia.com/qt5/qstring.html">QString</a></span> &amp;<i> name</i>, <span class="type"><a href="qextserialport.html#BaudRateType-enum">BaudRateType</a></span><i> baud</i>, <span class="type"><a href="http://doc.qt.nokia.com/qt5/qobject.html">QObject</a></span> *<i> parent</i> = 0)</h3>
<p>This is an overloaded function.</p>
<p>Constructs a port with specified <i>name</i> and specified settings.</p>
<!-- @@@QextSerialPort -->
<!-- $$$QextSerialPort$$$QextSerialPortconstQString&BaudRateTypeParityTypeDataBitsTypeStopBitsTypeQObject* -->
<h3 class="fn"><a name="QextSerialPort-4"></a>QextSerialPort::<span class="name">QextSerialPort</span>(const <span class="type"><a href="http://doc.qt.nokia.com/qt5/qstring.html">QString</a></span> &amp;<i> name</i>, <span class="type"><a href="qextserialport.html#BaudRateType-enum">BaudRateType</a></span><i> baud</i>, <span class="type"><a href="qextserialport.html#ParityType-enum">ParityType</a></span><i> par</i>, <span class="type"><a href="qextserialport.html#DataBitsType-enum">DataBitsType</a></span><i> dataBits</i>, <span class="type"><a href="qextserialport.html#StopBitsType-enum">StopBitsType</a></span><i> stopBits</i>, <span class="type"><a href="http://doc.qt.nokia.com/qt5/qobject.html">QObject</a></span> *<i> parent</i> = 0)</h3>
<p>This is an overloaded function.</p>
<p>Constructs a port with specified <i>name</i> and settings.</p>
<!-- @@@QextSerialPort -->
<!-- $$$~QextSerialPort[overload1]$$$~QextSerialPort -->
<h3 class="fn"><a name="dtor.QextSerialPort"></a>QextSerialPort::<span class="name">~QextSerialPort</span>()</h3>
<p>Destructs the <a href="qextserialport.html">QextSerialPort</a> object.</p>
<!-- @@@~QextSerialPort -->
<!-- $$$bytesAvailable[overload1]$$$bytesAvailable -->
<h3 class="fn"><a name="bytesAvailable"></a><span class="type"><a href="http://doc.qt.nokia.com/qt5/qtglobal.html#qint64-typedef">qint64</a></span> QextSerialPort::<span class="name">bytesAvailable</span>() const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#bytesAvailable">QIODevice::bytesAvailable</a>().</p>
<p>Returns the number of bytes waiting in the port's receive queue. This function will return 0 if the port is not currently open, or -1 on error.</p>
<!-- @@@bytesAvailable -->
<!-- $$$canReadLine[overload1]$$$canReadLine -->
<h3 class="fn"><a name="canReadLine"></a><span class="type">bool</span> QextSerialPort::<span class="name">canReadLine</span>() const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#canReadLine">QIODevice::canReadLine</a>().</p>
<!-- @@@canReadLine -->
<!-- $$$close[overload1]$$$close -->
<h3 class="fn"><a name="close"></a><span class="type">void</span> QextSerialPort::<span class="name">close</span>()<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#close">QIODevice::close</a>().</p>
<p>Closes a serial port. This function has no effect if the serial port associated with the class is not currently open.</p>
<!-- @@@close -->
<!-- $$$dsrChanged[overload1]$$$dsrChangedbool -->
<h3 class="fn"><a name="dsrChanged"></a><span class="type">void</span> QextSerialPort::<span class="name">dsrChanged</span>(<span class="type">bool</span><i> status</i>)<tt> [signal]</tt></h3>
<p>This signal is emitted whenever dsr line has changed its state. You may use this signal to check if device is connected.</p>
<p><i>status</i> true when DSR signal is on, false otherwise.</p>
<!-- @@@dsrChanged -->
<!-- $$$errorString[overload1]$$$errorString -->
<h3 class="fn"><a name="errorString"></a><span class="type"><a href="http://doc.qt.nokia.com/qt5/qstring.html">QString</a></span> QextSerialPort::<span class="name">errorString</span>()</h3>
<p>Returns a human-readable description of the last device error that occurred.</p>
<!-- @@@errorString -->
<!-- $$$flush[overload1]$$$flush -->
<h3 class="fn"><a name="flush"></a><span class="type">void</span> QextSerialPort::<span class="name">flush</span>()</h3>
<p>Flushes all pending I/O to the serial port. This function has no effect if the serial port associated with the class is not currently open.</p>
<!-- @@@flush -->
<!-- $$$isSequential[overload1]$$$isSequential -->
<h3 class="fn"><a name="isSequential"></a><span class="type">bool</span> QextSerialPort::<span class="name">isSequential</span>() const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isSequential">QIODevice::isSequential</a>().</p>
<p>Returns true if device is sequential, otherwise returns false. Serial port is sequential device so this function always returns true. Check <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isSequential">QIODevice::isSequential</a>() documentation for more information.</p>
<!-- @@@isSequential -->
<!-- $$$lastError[overload1]$$$lastError -->
<h3 class="fn"><a name="lastError"></a><span class="type"><a href="http://doc.qt.nokia.com/qt5/qtglobal.html#ulong-typedef">ulong</a></span> QextSerialPort::<span class="name">lastError</span>() const</h3>
<p>Return the error number, or 0 if no error occurred.</p>
<!-- @@@lastError -->
<!-- $$$lineStatus[overload1]$$$lineStatus -->
<h3 class="fn"><a name="lineStatus"></a><span class="type"><a href="http://doc.qt.nokia.com/qt5/qtglobal.html#ulong-typedef">ulong</a></span> QextSerialPort::<span class="name">lineStatus</span>()</h3>
<p>Returns the line status as stored by the port function. This function will retrieve the states of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned long with specific bits indicating which lines are high. The following constants should be used to examine the states of individual lines:</p>
<p>This function will return 0 if the port associated with the class is not currently open.</p>
<!-- @@@lineStatus -->
<!-- $$$open[overload1]$$$openOpenMode -->
<h3 class="fn"><a name="open"></a><span class="type">bool</span> QextSerialPort::<span class="name">open</span>(<span class="type"><a href="http://doc.qt.nokia.com/qt5/qiodevice.html#OpenMode-typedef">OpenMode</a></span><i> mode</i>)</h3>
<p>Opens a serial port and sets its <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#OpenMode-typedef">OpenMode</a> to <i>mode</i>. Note that this function does not specify which device to open. Returns true if successful; otherwise returns false.This function has no effect if the port associated with the class is already open. The port is also configured to the current settings, as stored in the Settings structure.</p>
<!-- @@@open -->
<!-- $$$readAll[overload1]$$$readAll -->
<h3 class="fn"><a name="readAll"></a><span class="type"><a href="http://doc.qt.nokia.com/qt5/qbytearray.html">QByteArray</a></span> QextSerialPort::<span class="name">readAll</span>()</h3>
<p>Reads all available data from the device, and returns it as a <a href="http://doc.qt.nokia.com/qt5/qbytearray.html">QByteArray</a>. This function has no way of reporting errors; returning an empty QByteArray() can mean either that no data was currently available for reading, or that an error occurred.</p>
<!-- @@@readAll -->
<!-- $$$readData[overload1]$$$readDatachar*qint64 -->
<h3 class="fn"><a name="readData"></a><span class="type"><a href="http://doc.qt.nokia.com/qt5/qtglobal.html#qint64-typedef">qint64</a></span> QextSerialPort::<span class="name">readData</span>(<span class="type">char</span> *<i> data</i>, <span class="type"><a href="http://doc.qt.nokia.com/qt5/qtglobal.html#qint64-typedef">qint64</a></span><i> maxSize</i>)<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#readData">QIODevice::readData</a>().</p>
<p>Reads a block of data from the serial port. This function will read at most maxlen bytes from the serial port and place them in the buffer pointed to by data. Return value is the number of bytes actually read, or -1 on error.</p>
<p><b>Warning:</b> before calling this function ensure that serial port associated with this class is currently open (use <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isOpen">isOpen</a>() function to check if port is open).</p>
<!-- @@@readData -->
<!-- $$$setDtr[overload1]$$$setDtrbool -->
<h3 class="fn"><a name="setDtr"></a><span class="type">void</span> QextSerialPort::<span class="name">setDtr</span>(<span class="type">bool</span><i> set</i> = true)<tt> [slot]</tt></h3>
<p>Sets DTR line to the requested state (<i>set</i> default to high). This function will have no effect if the port associated with the class is not currently open.</p>
<!-- @@@setDtr -->
<!-- $$$setRts[overload1]$$$setRtsbool -->
<h3 class="fn"><a name="setRts"></a><span class="type">void</span> QextSerialPort::<span class="name">setRts</span>(<span class="type">bool</span><i> set</i> = true)<tt> [slot]</tt></h3>
<p>Sets RTS line to the requested state <i>set</i> (high by default). This function will have no effect if the port associated with the class is not currently open.</p>
<!-- @@@setRts -->
<!-- $$$writeData[overload1]$$$writeDataconstchar*qint64 -->
<h3 class="fn"><a name="writeData"></a><span class="type"><a href="http://doc.qt.nokia.com/qt5/qtglobal.html#qint64-typedef">qint64</a></span> QextSerialPort::<span class="name">writeData</span>(const <span class="type">char</span> *<i> data</i>, <span class="type"><a href="http://doc.qt.nokia.com/qt5/qtglobal.html#qint64-typedef">qint64</a></span><i> maxSize</i>)<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#writeData">QIODevice::writeData</a>().</p>
<p>Writes a block of data to the serial port. This function will write len bytes from the buffer pointed to by data to the serial port. Return value is the number of bytes actually written, or -1 on error.</p>
<p><b>Warning:</b> before calling this function ensure that serial port associated with this class is currently open (use <a href="http://doc.qt.nokia.com/qt5/qiodevice.html#isOpen">isOpen</a>() function to check if port is open).</p>
<!-- @@@writeData -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2000-2012</td>
<td width="20%" align="center"><a href="http://code.google.com/p/qextserialport">QtExtSerialPort Project</a></td>
<td width="40%" align="right"><div align="right">QextSerialPort Manual</div></td>
</tr></table></div></address></body>
</html>
